<?xml version="1.0" encoding="ISO-8859-1"?>
<build xmlns="http://symbian.com/xml/build" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symbian.com/xml/build ../../schema/build/2_0.xsd">
	<!-- build variants for GCC toolchains -->
	<var name="tools2_base" extends="root">
		<varRef ref="default.interfaces"/>
		<varRef ref="default.locations"/>
		
		<!-- toolchain tools -->
		<env name='RANLIB' default='$(GCCPREFIX)ranlib$(DOTEXE)' type='tool'/>
		<env name='GCC' default='$(GCCPREFIX)g++$(DOTEXE)' type='tool'/>
		<env name='AR' default='$(GCCPREFIX)ar$(DOTEXE)' type='tool'/>
		
		<set name='COMPILER' value='$(GCC) -c' type='tool' versionCommand='$(GCC) -v' versionResult='gcc version (3.[456])|(4.[0-9])'/>
		<set name='LINKER' value='$(GCC)'/>

		<!-- tools and scripts -->
		<env name='JAVATC' default='$(JAVA_HOME)/bin/java' type='tool'/> <!-- Java used by Trace Compiler -->
		<env name='JAVA_HOME' default='' type='path'/>		

		<!-- targettypes -->
		<set name="TARGET_TYPES" value="exe lib"/>

		<!-- interfaces -->
		<append name="INTERFACE_TYPES" value="$(TARGET_TYPES)"/>

		<set name="INTERFACE.exe" value="Tools.exe"/>
		<set name="INTERFACE.lib" value="Tools.lib"/>

		<!-- link to bld.inf and mmp platform names -->
		<set name='TRADITIONAL_PLATFORM' value='TOOLS2'/>

		<set name='CFLAGS' value='-static-libgcc -fdefer-pop -fmerge-constants -fthread-jumps -floop-optimize -fif-conversion -fif-conversion2 -fguess-branch-probability -fcprop-registers -foptimize-sibling-calls -fstrength-reduce -fcse-follow-jumps -fcse-skip-blocks -frerun-cse-after-loop -frerun-loop-opt -fgcse -fgcse-lm -fgcse-sm -fgcse-las -fdelete-null-pointer-checks -fexpensive-optimizations -fregmove -fschedule-insns -fschedule-insns2 -fsched-interblock -fsched-spec -fcaller-saves -fpeephole2 -freorder-blocks -freorder-functions -fstrict-aliasing -funit-at-a-time -falign-functions -falign-jumps -falign-loops -falign-labels -fcrossjumping -pipe -Wall -Wno-ctor-dtor-privacy -Wno-unknown-pragmas -m32'/>
		
		<set name='VARIANTPLATFORM' value='tools2'/>

		<set name='CFLAGS.WIN32' value=''/>

		<!-- macro definitions set by mmps etc -->
		<set name='CDEFS' value='$(MMPDEFS)'/>
		<set name='CDEFS.DEFAULT' value='__SYMBIAN32__ __TOOLS__ __TOOLS2__ __EXE__ __SUPPORT_CPP_EXCEPTIONS__ __PRODUCT_INCLUDE__="$(PRODUCT_INCLUDE)"'/>
		<set name='CDEFS.WIN32' value='$(CDEFS.DEFAULT) _WIN32 WIN32 _WINDOWS __TOOLS2_WINDOWS__'/>
		<set name='CDEFS.LINUX' value='$(CDEFS.DEFAULT) __LINUX__ __TOOLS2_LINUX__'/>

		<set name='PREINCLUDE' value='$(EPOCINCLUDE)/gcc_mingw/gcc_mingw.h'/>

		<set name='OPT.D' value='-D'/>
		<set name='OPT.L' value='-L'/>
		<set name='OPT.l' value='-l'/>
		<set name='OPT.O' value='-o '/>
		<set name='OPT.PREINCLUDE' value='-include '/>
		<set name='OPT.SYSTEMINCLUDE' value='-isystem '/>
		<set name='OPT.USERINCLUDE' value='-I '/>

		<!-- always use stlport headers; when the move to STLport 5.2 is made, the SBS_STLPORTINCDIR 
			 default should be updated to $(EPOCINCLUDE)/tools/stlport5.2 -->
		<env name='SBS_STLPORTINCDIR' default='$(EPOCINCLUDE)/tools/stlport' type='path'/>
		<set name='SYSTEMINCLUDE' value='$(SBS_STLPORTINCDIR)'/>

		<set name='LFLAGS' value=''/>
		<set name='STATICLIBRARY' value=''/>
		<set name='LIBS' value=''/>
		<set name='LIBS.WIN32' value='$(LIBS)'/>
		<set name='LIBS.LINUX' value='$(LIBS) pthread'/>

		<set name='PLATMACROS.WINDOWS' value='GCC32 TOOLS2 TOOLS2_WINDOWS'/>
		<set name='PLATMACROS.LINUX' value='GCC32 TOOLS2 TOOLS2_LINUX'/>

		<set name='ARCHIVER' value='$(AR)'/>
		<set name='AFLAGS' value='cr'/>

		<set name='MMPDEFS' value=''/>
		<set name='TARGET' value=''/>
		<set name='TARGETTYPE' value=''/>

		<set name='OUTPUTPATH' value='$(SBS_BUILD_DIR)'/>
		<env name='SBS_STLPORTBINDIR' default='$(EPOCROOT)/epoc32/release/tools2' host='win.*' type='path'/>
		<env name='SBS_STLPORTBINDIR' default='$(EPOCROOT)/epoc32/release/tools2/$(HOSTPLATFORM32_DIR)' host='lin.*' type='path'/>
		<set name='STLPORTBINDIR' value='$(SBS_STLPORTBINDIR)'/>
		<set name='STLPORTLIBRARY' value='stlport.5.1'/>
		<set name='RELEASEPATH' value='$(EPOCROOT)/epoc32/release/tools2' host='win.*' type='path'/>
		<!-- Tools are 32-bit at the moment, so use the 32-bit directory -->
		<set name='RELEASEPATH' value='$(EPOCROOT)/epoc32/release/tools2/$(HOSTPLATFORM32_DIR)' host='lin.*' type='path'/>
	</var>

	<var name="t_deb">
		<set name='TOOLSPATH' value=''/> <!-- do not install -->
		<set name='VARIANTTYPE' value='deb'/>

		<append name='CFLAGS' value='-g'/>
		<append name='CDEFS' value='_DEBUG'/>
		<append name='RELEASEPATH' value='/deb' separator=''/>
		<append name='STLPORTBINDIR' value='/deb' separator=''/>		
	</var>
	<alias name="tools2_deb" meaning="tools2_base.t_deb"/>
	
	<var name="t_rel">
		<set name='TOOLSPATH' value='$(EPOCROOT)/epoc32/tools'/> <!-- install -->
		<set name='VARIANTTYPE' value='rel'/>

		<append name='CFLAGS' value='-s'/>
		<append name='CDEFS' value='NDEBUG'/>
		<append name='RELEASEPATH' value='/rel' separator=''/>
		<append name='STLPORTBINDIR' value='/rel' separator=''/>		
	</var>
	<alias name="tools2_rel" meaning="tools2_base.t_rel"/>
	
	<group name="tools2">
		<aliasRef ref='tools2_rel'/>
		<aliasRef ref='tools2_deb'/>
	</group>

</build>
